package com.learn.educourseboot.controller;


import com.learn.common.result.Result;
import com.learn.educourseboot.entity.Course;
import com.learn.educourseboot.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 课程 前端控制器
 * </p>
 *
 * @author m
 * @since 2022-04-22
 */
@RestController
@RequestMapping("/course/course")
@CrossOrigin
public class CourseController {
        @Autowired
        private CourseService courseService;

        @GetMapping("/getAllCourse")
    public Result getAllCourse(){
            List<Course> course = courseService.getAllCourse();
            return Result.ok().setData("data",course);
        }
}

